package com.str;

public class upper {
  public static void main(String[] args) {
    //
    String s1 = "i am a java coder";
    char[] ar1 = s1.toCharArray();
    for (int i = 0; i < ar1.length; i++) {
      if (i == 0) {
        ar1[i] -= 32;
      }
      if (ar1[i] == ' ') {
        String.valueOf(ar1[i + 1] -= 32);
      }
    }
    System.out.println(String.valueOf(ar1));

    char[] ar2 = s1.toCharArray();
    int count = 0;
    for (char a : ar2) {
      if (String.valueOf(a).isBlank()) {
        count += 1;
      }
    }
    System.out.println(count);
  }
}
